﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="View_CompareValidator2.aspx.cs" Inherits="AFCEPF.Samples.WebSamples.Controls2.View_CompareValidator2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h3>
        CompareValidator (advanced)
    </h3>
    <table border="0" bgcolor="#b0c4de">
        <tr valign="top">
            <td colspan="4">
                <h4>
                    Compare two values</h4>
            </td>
        </tr>
        <tr valign="top">
            <td>
                <asp:TextBox ID="txt1" runat="server" />
            </td>
            <td>
                <asp:ListBox ID="list" Rows="2" OnSelectedIndexChanged="check_operator" runat="server">
                    <asp:ListItem Value="Equal" Selected>=</asp:ListItem>
                    <asp:ListItem Value="NotEqual"><></asp:ListItem>
                </asp:ListBox>
            </td>
            <td>
                <asp:TextBox ID="txt2" runat="server" />
            </td>
            <td>
                <asp:Button ID="Button1" Text="Validate" runat="server" />
            </td>
        </tr>
    </table>
    <br />
    <asp:CompareValidator ID="compval" Display="dynamic" ControlToValidate="txt1" ControlToCompare="txt2"
        ForeColor="red" BackColor="yellow" Type="String" EnableClientScript="false" Text="Validation Failed!"
        runat="server" />
    <br />
    Try to change the "EnableClientScript" property of the CompareValidator to avoid a postback
    until the two values to compare are equal.
</asp:Content>
